package vista;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;

import controlador.Banco;

public abstract class IngresoDatos extends JFrame {
	private Banco banco;
	private JPanel panel;

	private JButton aceptar;
	private JButton cancelar;

	public IngresoDatos(Banco banco) {
		this.banco = banco;
		initGUI();
	}

	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

			panel = new JPanel();
			panel.setLayout(null);
			panel.setBounds(1, 1, 399, 299);
			setContentPane(panel);

			aceptar = new JButton();
			aceptar.setPreferredSize(new java.awt.Dimension(100, 35));
			aceptar.setBounds(80 + super.getContentPane().getInsets().left,
					200 + super.getContentPane().getInsets().top,
					aceptar.getPreferredSize().width,
					aceptar.getPreferredSize().height);
			add(aceptar);

			cancelar = new JButton();
			cancelar.setText("Cancelar");
			cancelar.setPreferredSize(new java.awt.Dimension(100, 35));
			cancelar.setBounds(220 + panel.getInsets().left,
					200 + panel.getInsets().top,
					cancelar.getPreferredSize().width,
					cancelar.getPreferredSize().height);
			cancelar.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {
					dispose();
				}
			});
			panel.add(cancelar);

			setSize(400, 300);
			setResizable(false);
			setLocationRelativeTo(null);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public Banco getBanco() {
		return banco;
	}

	public JPanel getPanel() {
		return panel;
	}

	public JButton getAceptar() {
		return aceptar;
	}
}